@model List<zhangmenren.ViewModel.ProductModel>
<div class="bg-gray ">
	<header class="mui-bar mui-bar-nav head-bar-nav">
		<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" href='@Url.Action("Index","Home")'></a>
		<h1 class="mui-title">项目列表</h1>
		<a class="mui-icon mui-icon-more mui-pull-right" onclick="jsBridge.share()"></a>
	</header>
	<!--DOM -->
    <div class="mui-content ">
        @if (Model.Count > 0)
    {
        <ul class="mui-table-view">

            @foreach (var item in Model)
        {
            <li class="mui-table-view-cell mui-media">
                <a class="mui-navigate-right" href='/Map/Maps?id=@item.Id'>
                    <div class="mui-media-body">
                        <h5 style="font-size: 18px;">@item.Title</h5>
                        <p>点数量：@item.ItemNum  <span style="margin-left:10px">时间：@string.Format("{0:MM-dd HH:mm}",item.AddDT)</span></p>
                    </div>
                </a>
            </li>
    }
        </ul>
        }else{
            <span>暂无项目</span>
        }





    </div>

	<div class="toinfo-detail-flexed-box">
		<a href='javascript:;' onclick="add()" class="mui-btn mui-btn-block mui-btn-yellow">
			添加项目
		</a>
	</div>
</div>

@section Scripts{
<script>
	function add() {
		layerm.open({
			title: [
				'请输入项目名称',
				'background-color:#00a5bb; color:#fff;'
			],
			content: '<input type="text" style="width: 80%;" id="title" value="" placeholder="请输入项目名称" />',
			btn: ['确认', '取消'],
			yes: function(index) {
				var title=$("#title").val();
				layerm.close(index);
				if (title.length == 0) {
					rlayer.open({
						content: '请输入项目名称',
						btn: '我知道了'
					});
					return false;
				}
				
				$.ajax({
					type:"post",
					url:'@Url.Action("Adds")',
					data:{title:title},
					success:function(ret){
						if(ret.state==1){
							location.reload();
						}else if(ret.state==2){
							location.href=ret.url;
						}
					}
				})
				
				
			}
		});
	}
</script>
}
